<?php

namespace app\common\model;

use think\Cache;
use think\Collection;
use think\Model;

/**
 * 仓库基础资料录入数据模型
 */
class Warehouse extends Model
{
    protected $resultSetType = 'collection';
     public static function getList(){
         $field = 'id,number,name';
         $data = self::field($field)->where('switch',1)->select();
         return $data;
     }

    public static function getIdandName($where = []){

        return self::where($where)->field('id,name')->select()->toArray();
    }
    public static function getWarehouse($where = []){
        return self::where($where)->column('name','id');
    }
    public static function getNumber($where = []){

        return self::where($where)->limit(1)->value('number');
    }
}
